const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
const platform = process.platform;
module.exports = {
  packagerConfig: {
    ///额外资源目录
    extraResource: [
      './src/assets',
      './src/components',
    ],
    // 是否覆盖已经生成的文件
    overwrite: true,
     // 应用名称
    name: "一体机字段处理工具app",
    executableName: "all-in-one",
    // 打包平台，macOS 用 'darwin'
    platform: platform,//"darwin", //默认不设置是系统环境
    // 架构，对于大多数 macOS 应用来说是 'x64'  arch 
    //arch: "x64",  //默认不设置是系统环境
    // 应用程序的图标
    icon: "app",//platform == 'darwin' ? "app.icns" : "app.ico",自动寻找
    // 应用的版权说明
    appCopyright: 'Copyright © 2024 lion.com版权所有',
    // 应用程序的版本
    appVersion: "1.0.0",
    // macOS 的 bundle ID
    appBundleId: "com.electron.www.test",
    // macOS 的帮助文件 bundle ID
    helperBundleId: "com.electron.www.test.helper",
    // 打包输出目录
    out: "./out",
    // 是否打包为 ASAR 归档文件
    asar: true,
    win32metadata: {
      "ProductName": "五笔助手 Windows",
      "CompanyName": "kylebing.cn",
      "FileDescription": "五笔助手 for 小狼毫"
    }
  },
  rebuildConfig: {},
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {
        "name": "一体机字段处理工具win",
      },
    },
    {
      name: '@electron-forge/maker-zip',
      platforms: ['darwin'],
    },
    {
      name: '@electron-forge/maker-dmg',
      config: {
        format: 'ULFO'
      }
    },
    // {
    //   name: '@electron-forge/maker-pkg',
    //   config: {
    //     // PKG 特定配置 Developer ID Installer: Your Name (Team ID) 打包指令： npx electron-forge make --target pkg
    //     identity: 'com.electron.www.test',
    //     format: 'ULFO'
    //   }
    // },
    {
      name: '@electron-forge/maker-deb',
      config: {},
    },
    {
      name: '@electron-forge/maker-rpm',
      config: {},
    },
  ],
  plugins: [
    {
      name: '@electron-forge/plugin-auto-unpack-natives',
      config: {},
    },
    // Fuses are used to enable/disable various Electron functionality
    // at package time, before code signing the application
    new FusesPlugin({
      version: FuseVersion.V1,
      [FuseV1Options.RunAsNode]: false,
      [FuseV1Options.EnableCookieEncryption]: true,
      [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
      [FuseV1Options.EnableNodeCliInspectArguments]: false,
      [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
      [FuseV1Options.OnlyLoadAppFromAsar]: true,
    }),
  ],
 
};
